Skip to content

fix: resolve NameError for undefined 'card_number' in identify_json#3

Open
Washio20 wants to merge 1 commit intomainfrom
fix/bug-14
Open

fix: resolve NameError for undefined 'card_number' in identify_json#3
Washio20 wants to merge 1 commit intomainfrom
fix/bug-14

Conversation

@Washio20
Copy link
Owner

Summary

Fix NameError: name 'card_number' is not defined in router/identify.py at line 64. The identify_json endpoint was referencing an undefined variable card_number instead of accessing card.number from the CardQuery parameter.

Root Cause

The identify_json function receives a card: CardQuery parameter, but the call to verify_card on line 64 passed card_number (an undefined variable) instead of card.number. This was likely caused by a refactoring where the parameter was renamed from card_number to a CardQuery object but the reference inside the function body was not updated.

Changes

  • Changed card_number=card_number to card_number=card.number in router/identify.py line 64

Testing

  • Verified that the CardQuery model has a number field (defined in src/card.py line 98-99)
  • Verified that verify_card expects a card_number: str parameter (line 18)
  • The fix correctly extracts the string number from the CardQuery object to pass to verify_card

Closes stayforge/Stayforge_Networks_Access#14

…ndpoint (Closes stayforge/Stayforge_Networks_Access#14)

The identify_json function parameter is 'card' (a CardQuery object), but line 64
referenced the undefined variable 'card_number'. Changed to 'card.number' to
correctly access the number field from the CardQuery model.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant